home *** CD-ROM | disk | FTP | other *** search
- #cs
- From MSDN:
- typedef struct _OSVERSIONINFO
- {
- DWORD dwOSVersionInfoSize; //1
- DWORD dwMajorVersion; //2
- DWORD dwMinorVersion; //3
- DWORD dwBuildNumber; //4
- DWORD dwPlatformId; //5
- TCHAR szCSDVersion[ 128 ]; //6
- } OSVERSIONINFO;
- #ce
- $p = DllStructCreate("dword;dword;dword;dword;dword;char[128]")
-
- ;think of this as p->dwOSVersionInfoSize = sizeof(OSVERSIONINFO)
- DllStructSetData($p, 1, DllStructGetSize($p))
-
- ;make the DllCall
- $ret = DllCall("kernel32.dll","int","GetVersionEx","ptr",DllStructGetPtr($p))
-
- if Not $ret[0] Then
- MsgBox(0,"DllCall Error","DllCall Failed")
- exit
- EndIf
-
- ;get the returned values
- $major = DllStructGetData($p,2)
- $minor = DllStructGetData($p,3)
- $build = DllStructGetData($p,4)
- $platform = DllStructGetData($p,5)
- $version = DllStructGetData($p,6)
-
- ;free the struct
- $p =0
-
- msgbox(0,"","Major: " & $major & @CRLF & _
- "Minor: " & $minor & @CRLF & _
- "Build: " & $build & @CRLF & _
- "Platform ID: " & $platform & @CRLF & _
- "Version: " & $version)
-
-